#include "config.h"
#endif
-#include <math.h>
#include <stdlib.h>
#include <string.h>
spacing = 6;
st_theme_node_get_length (theme_node, "border-spacing", FALSE, &spacing);
- priv->spacing = round (spacing);
+ priv->spacing = (int)(0.5 + spacing);
/* update the label styling */
st_button_update_label_style (button);
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-#include <math.h>
#include <stdlib.h>
#include <string.h>
if (term->content.num->type != NUM_GENERIC)
return FALSE;
- weight_int = (int)(term->content.num->val + 0.5);
+ weight_int = (int)(0.5 + term->content.num->val);
*weight = weight_int;
*weight_absolute = TRUE;
if (term->content.num->type == NUM_GENERIC)
{
- borders[n_borders] = round (0.5 + term->content.num->val);
+ borders[n_borders] = (int)(0.5 + term->content.num->val);
n_borders++;
}
else if (term->content.num->type == NUM_PERCENTAGE)
static float
get_width_inc (StThemeNode *node)
{
- return (round (node->border_width[ST_SIDE_LEFT]) + node->padding[ST_SIDE_LEFT] +
- round (node->border_width[ST_SIDE_RIGHT]) + node->padding[ST_SIDE_RIGHT]);
+ return ((int)(0.5 + node->border_width[ST_SIDE_LEFT]) + node->padding[ST_SIDE_LEFT] +
+ (int)(0.5 + node->border_width[ST_SIDE_RIGHT]) + node->padding[ST_SIDE_RIGHT]);
}
static float
get_height_inc (StThemeNode *node)
{
- return (round (node->border_width[ST_SIDE_TOP]) + node->padding[ST_SIDE_TOP] +
- round (node->border_width[ST_SIDE_BOTTOM]) + node->padding[ST_SIDE_BOTTOM]);
+ return ((int)(0.5 + node->border_width[ST_SIDE_TOP]) + node->padding[ST_SIDE_TOP] +
+ (int)(0.5 + node->border_width[ST_SIDE_BOTTOM]) + node->padding[ST_SIDE_BOTTOM]);
}
/**
ensure_borders (node);
- content_box->x1 = round (node->border_width[ST_SIDE_LEFT]) + node->padding[ST_SIDE_LEFT];
- content_box->y1 = round (node->border_width[ST_SIDE_TOP]) + node->padding[ST_SIDE_TOP];
- content_box->x2 = allocation->x2 - allocation->x1 - (round (node->border_width[ST_SIDE_RIGHT]) + node->padding[ST_SIDE_RIGHT]);
- content_box->y2 = allocation->y2 - allocation->y1 - (round (node->border_width[ST_SIDE_BOTTOM]) + node->padding[ST_SIDE_BOTTOM]);
+ content_box->x1 = (int)(0.5 + node->border_width[ST_SIDE_LEFT]) + node->padding[ST_SIDE_LEFT];
+ content_box->y1 = (int)(0.5 + node->border_width[ST_SIDE_TOP]) + node->padding[ST_SIDE_TOP];
+ content_box->x2 = allocation->x2 - allocation->x1 - ((int)(0.5 + node->border_width[ST_SIDE_RIGHT]) + node->padding[ST_SIDE_RIGHT]);
+ content_box->y2 = allocation->y2 - allocation->y1 - ((int)(0.5 + node->border_width[ST_SIDE_BOTTOM]) + node->padding[ST_SIDE_BOTTOM]);
}
#include "config.h"
#endif
-#include <math.h>
#include <stdlib.h>
#include <string.h>
double width = st_theme_node_get_border_width (theme_node, side);
if (width > 0.5)
{
- border_width = round (width);
+ border_width = (int)(0.5 + width);
st_theme_node_get_border_color (theme_node, side, &border_color);
break;
}
double radius = st_theme_node_get_border_radius (theme_node, corner);
if (radius > 0.5)
{
- border_radius = round (radius);
+ border_radius = (int)(0.5 + radius);
break;
}
}